import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif'] = ['SimHei']

sales = [15.5, 9.7, 18.5, 16.1, 18.7, 23.0, 22.2, 24.9, 33.4, 31.7, 37.9, 47.5]

plt.subplot(121)
plt.plot(np.arange(0, 12, 1), sales, c="r", marker="D")
plt.xticks(np.arange(0, 12 + 1, 1))
plt.title("销量折线图")
plt.xlabel("月份")
plt.ylabel("销量(万辆)")

plt.subplot(122)
plt.bar(np.arange(1, 12 + 1, 1), sales, color="b", width=0.3)
plt.title("销量柱状图")

plt.show()
